﻿using Architecture.Domain.Service;
using Architecture.Repository.Interface;
using Architeture.Domain.DTO;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand.RoleMenu;
using RBAC.ZhuBoLin.Application.Command.RoleCommand.RoleMenus;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler.RoleMenu
{
    public class RoleMenuSelectByidCommandHandler : IRequestHandler<RoleMenuSelectByidCommand, List<RoleMenuDTO>>
    {
        protected readonly IRoleMneuService roleMneu;

        public RoleMenuSelectByidCommandHandler(IRoleMneuService roleMneu)
        {
            this.roleMneu = roleMneu;
        }

        public async Task<List<RoleMenuDTO>> Handle(RoleMenuSelectByidCommand request, CancellationToken cancellationToken)
        {
            return await roleMneu.GetRoleId(request.id);
        }
    }
}
